home *** CD-ROM | disk | FTP | other *** search
- #include "stdafx.h"
-
- cInventory::cInventory(cInventory **list)
- {
- remaining = -1;
- icon = 0;
-
- add((cList **)list);
- }
-
- cInventory::~cInventory()
- {
- }
-
- void cInventory::fire(cSpot *, int, int, fix, cGameObject *)
- {
- }
-
- cInventoryMine::cInventoryMine(cInventory **list) : cInventory(list)
- {
- fire_delay = 2 * sec;
- icon = mine_icon;
- remaining = NUM_MINES;
- }
-
- void cInventoryMine::fire(cSpot *o, int x, int y, fix, cGameObject *owner)
- {
- if (o != 0)
- x += o->x, y -= o->y;
-
- new cMine (x, y, owner);
-
- remaining--;
-
- if (remaining <= 0)
- delete this;
- }
-
- cInventoryBullet::cInventoryBullet(cInventory **list) : cInventory(list)
- {
- fire_delay = BULLET_FIRE_DELAY;
- }
-
- void cInventoryBullet::fire(cSpot *o, int x, int y, fix angle, cGameObject *owner)
- {
- if (o != 0)
- x += o->x, y -= o->y;
-
- new cBullet (x, y, angle, owner);
-
- new cEffect (x, y, bullet, "FIRE");
- }
-
- cInventorySpread::cInventorySpread(cInventory **list) : cInventory(list)
- {
- fire_delay = SPREAD_FIRE_DELAY;
- icon = spread_gun_icon;
- remaining = NUM_SPREAD;
- }
-
- void cInventorySpread::fire(cSpot *o, int x, int y, fix angle, cGameObject *owner)
- {
- if (o != 0)
- x += o->x, y -= o->y;
-
- new cBullet (x, y, angle, owner);
- new cBullet (x, y, angle - (fix)25, owner);
- new cBullet (x, y, angle + (fix)25, owner);
-
- new cEffect (x, y, bullet, "FIRE");
-
- remaining--;
-
- if (remaining <= 0)
- delete this;
- }
-
- cInventoryRocket::cInventoryRocket(cInventory **list) : cInventory(list)
- {
- fire_delay = ROCKET_FIRE_DELAY;
- icon = rocket_icon;
- remaining = NUM_ROCKET;
- }
-
- void cInventoryRocket::fire(cSpot *o, int x, int y, fix angle, cGameObject *owner)
- {
- if (o != 0)
- x += o->x, y -= o->y;
-
- new cRocket (x, y, angle, owner);
-
- new cEffect (x, y, rocket, "FIRE");
-
- remaining--;
-
- if (remaining <= 0)
- delete this;
- }
-
- cInventoryThumper::cInventoryThumper(cInventory **list) : cInventory(list)
- {
- fire_delay = THUMPER_FIRE_DELAY;
- icon = thumper_icon;
- remaining = NUM_THUMPER;
- }
-
- void cInventoryThumper::fire(cSpot *o, int x, int y, fix, cGameObject *owner)
- {
- if (o != 0)
- x += o->x, y -= o->y;
-
- new cThumper (x, y);
-
- remaining--;
-
- if (remaining <= 0)
- delete this;
- }
-